<template>
  <el-dialog title="查看" :close-on-click-modal="false" :visible.sync="visible" width="600px">
    <el-form :model="dataForm"  @keyup.enter.native="dataFormSubmit()" label-width="150px">
        <el-form-item label="评价内容:">

            <img
            :src="item" v-for="(item,index) in dataForm.imgUrls" :key="index"
            style="height: 120px;width: 120px"
            >
            <div>{{dataForm.content}}</div>
        </el-form-item>
          <el-form-item label="评价回复:" v-if="dataForm.reply_list&&dataForm.reply_list.length>0">
            <div>
              {{dataForm.reply_list[0].content}}
            </div>
          </el-form-item>
    </el-form>
     
    <span slot="footer" class="dialog-footer">
      <el-button @click="close()">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import {treeDataTranslate} from '@/utils'

  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          imgUrls: [],
          content: ''
        }
      }
    },

    methods: {
      init (row) {
        this.visible = true
        this.dataForm = JSON.parse(JSON.stringify(row))
        if (row.img) {
          this.dataForm.imgUrls = row.img.split(',')
        }
      },
      close () {
        this.visible = false
      }
    }
  }
</script>

<style lang="scss">
img{
  margin-right: 10px;
  }
</style>
